package ZuoYe19;

import java.util.*;

public class Di6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map a = new HashMap();
        a.put("老鼠", "mouse");
        a.put("牛", "Niu");
        a.put("虎", "tiger");
        a.put("兔", "rabbit");
        a.put("龙", "dragon");
        while (true) {
            System.out.println("1,汉-英   2，英-汉");
            int b = sc.nextInt();
            if (b == 1) {
                System.out.println("输入汉语");
                String c = sc.next();
                if (a.get(c) != null) {
                    System.out.println(a.get(c));
                    break;
                } else System.out.println("不存在");

            } else if (b == 2) {
                System.out.println("输入英语");
                String d = sc.next();
                Set set = a.entrySet();
                Iterator ir = set.iterator();
                boolean x = true;
                while (ir.hasNext()) {
                    Map.Entry entry = (Map.Entry) ir.next();
                    if (entry.getValue().equals(d)) {
                        System.out.println(entry.getKey());
                        x = false;
                        break;

                    }
                }
                if (x) {
                    System.out.println("无法翻译");
                }
            }
        }

    }
}
